#!/bin/bash

# check
if [ -e /dev/sdb ];then
    echo "find sdcard success!"
else
    echo "find sdcard fail!"
    exit
fi

# write
sudo dd iflag=dsync oflag=dsync if=u-boot.imx of=/dev/sdb bs=512 seek=2
